package abs.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import java.util.Calendar;
import java.util.Set;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllSucursaless", query = "select mySucursales from Sucursales mySucursales"),
		@NamedQuery(name = "findSucursalesByCo001cdgo", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001cdgo = ?1"),
		@NamedQuery(name = "findSucursalesByCo001cdgoContaining", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001cdgo like ?1"),
		@NamedQuery(name = "findSucursalesByCo001esta", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001esta = ?1"),
		@NamedQuery(name = "findSucursalesByCo001estaContaining", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001esta like ?1"),
		@NamedQuery(name = "findSucursalesByCo001fead", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001fead = ?1"),
		@NamedQuery(name = "findSucursalesByCo001feadAfter", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001fead > ?1"),
		@NamedQuery(name = "findSucursalesByCo001feadBefore", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001fead < ?1"),
		@NamedQuery(name = "findSucursalesByCo001femo", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001femo = ?1"),
		@NamedQuery(name = "findSucursalesByCo001femoAfter", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001femo > ?1"),
		@NamedQuery(name = "findSucursalesByCo001femoBefore", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001femo < ?1"),
		@NamedQuery(name = "findSucursalesByCo001load", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001load = ?1"),
		@NamedQuery(name = "findSucursalesByCo001loadContaining", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001load like ?1"),
		@NamedQuery(name = "findSucursalesByCo001lomo", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001lomo = ?1"),
		@NamedQuery(name = "findSucursalesByCo001lomoContaining", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001lomo like ?1"),
		@NamedQuery(name = "findSucursalesByCo001nomb", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001nomb = ?1"),
		@NamedQuery(name = "findSucursalesByCo001nombContaining", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001nomb like ?1"),
		@NamedQuery(name = "findSucursalesByPrimaryKey", query = "select mySucursales from Sucursales mySucursales where mySucursales.co001cdgo = ?1") })
@Table(catalog = "absV2", name = "co001")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "absWeb/abs/domain", name = "Sucursales")
public class Sucursales implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * CODIGO
	 * 
	 */

	@Column(name = "co001cdgo", length = 3, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	String co001cdgo;
	/**
	 * NOMBRE
	 * 
	 */

	@Column(name = "co001nomb", length = 200)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String co001nomb;
	/**
	 * ESTADO
	 * 
	 */

	@Column(name = "co001esta", length = 1)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String co001esta;
	/**
	 * USUARIO ADICION
	 * 
	 */

	@Column(name = "co001load", length = 50)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String co001load;
	/**
	 * FECHA ADICION
	 * 
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "co001fead")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar co001fead;
	/**
	 * USUARIO MODIFICACION
	 * 
	 */

	@Column(name = "co001lomo", length = 50)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String co001lomo;
	/**
	 * FECHA MODIFICACION
	 * 
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "co001femo")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar co001femo;

	/**
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({ @JoinColumn(name = "co001nocia", referencedColumnName = "co000nocia", nullable = false) })
	@XmlTransient
	Companias companias;

	/**
	 * CODIGO
	 * 
	 */
	public void setCo001cdgo(String co001cdgo) {
		this.co001cdgo = co001cdgo;
	}

	/**
	 * CODIGO
	 * 
	 */
	public String getCo001cdgo() {
		return this.co001cdgo;
	}

	/**
	 * NOMBRE
	 * 
	 */
	public void setCo001nomb(String co001nomb) {
		this.co001nomb = co001nomb;
	}

	/**
	 * NOMBRE
	 * 
	 */
	public String getCo001nomb() {
		return this.co001nomb;
	}

	/**
	 * ESTADO
	 * 
	 */
	public void setCo001esta(String co001esta) {
		this.co001esta = co001esta;
	}

	/**
	 * ESTADO
	 * 
	 */
	public String getCo001esta() {
		return this.co001esta;
	}

	/**
	 * USUARIO ADICION
	 * 
	 */
	public void setCo001load(String co001load) {
		this.co001load = co001load;
	}

	/**
	 * USUARIO ADICION
	 * 
	 */
	public String getCo001load() {
		return this.co001load;
	}

	/**
	 * FECHA ADICION
	 * 
	 */
	public void setCo001fead(Calendar co001fead) {
		this.co001fead = co001fead;
	}

	/**
	 * FECHA ADICION
	 * 
	 */
	public Calendar getCo001fead() {
		return this.co001fead;
	}

	/**
	 * USUARIO MODIFICACION
	 * 
	 */
	public void setCo001lomo(String co001lomo) {
		this.co001lomo = co001lomo;
	}

	/**
	 * USUARIO MODIFICACION
	 * 
	 */
	public String getCo001lomo() {
		return this.co001lomo;
	}

	/**
	 * FECHA MODIFICACION
	 * 
	 */
	public void setCo001femo(Calendar co001femo) {
		this.co001femo = co001femo;
	}

	/**
	 * FECHA MODIFICACION
	 * 
	 */
	public Calendar getCo001femo() {
		return this.co001femo;
	}

	/**
	 */
	public void setCompanias(Companias companias) {
		this.companias = companias;
	}

	/**
	 */
	public Companias getCompanias() {
		return companias;
	}

	/**
	 */
	public Sucursales() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Sucursales that) {
		setCo001cdgo(that.getCo001cdgo());
		setCo001nomb(that.getCo001nomb());
		setCo001esta(that.getCo001esta());
		setCo001load(that.getCo001load());
		setCo001fead(that.getCo001fead());
		setCo001lomo(that.getCo001lomo());
		setCo001femo(that.getCo001femo());
		setCompanias(that.getCompanias());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("co001cdgo=[").append(co001cdgo).append("] ");
		buffer.append("co001nomb=[").append(co001nomb).append("] ");
		buffer.append("co001esta=[").append(co001esta).append("] ");
		buffer.append("co001load=[").append(co001load).append("] ");
		buffer.append("co001fead=[").append(co001fead).append("] ");
		buffer.append("co001lomo=[").append(co001lomo).append("] ");
		buffer.append("co001femo=[").append(co001femo).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((co001cdgo == null) ? 0 : co001cdgo.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Sucursales))
			return false;
		Sucursales equalCheck = (Sucursales) obj;
		if ((co001cdgo == null && equalCheck.co001cdgo != null) || (co001cdgo != null && equalCheck.co001cdgo == null))
			return false;
		if (co001cdgo != null && !co001cdgo.equals(equalCheck.co001cdgo))
			return false;
		return true;
	}
}
